package com.admin.service.impl;

import com.admin.entity.Region;
import com.admin.mapper.RegionMapper;
import com.admin.service.IRegionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author marisheng
 * @since 2019-11-21
 */
@Service
public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements IRegionService {

    @Autowired
    private RegionMapper regionMapper;

    //区域查询
    @Override
    public List<Region> regionAll(){
        List<Region> regions = regionMapper.selectList(null);
            return regions;
    }

    /**
     * 根据id查区域
     * @param id
     * @return
     */
    public Region selregionByid(int id){
        return regionMapper.selectById(id);
    }
}
